<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%-- <%@include file="/common/common.jspf"%> --%>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/forming/progress/statistics_add.js"></script>
<script type="text/javascript">
var clock;//上模时间                                                                        
var complete;//完成模时间                                                                        
$(function(){
	$("#machine").click("click",function() {
		var machine_Number=$('#Machine_Number').val();
		alert(machine_Number);
		var mold_Number=$('#Mold_Number').val();
		//记录上模时间 
		clock=(new Date()).getTime(); 
		alert(clock);
			$.ajax({
				    "type" : "post",//请求方式
				    "url" : "${pageContext.request.contextPath}/progress/regulator_search.shtml", //请求路径
					"data" : {"Machine_Number" : machine_Number,"Mold_Number" : mold_Number}, //带参数数据
					"dataType" : "json",//数据类型
					"success" : function(user) { //成功后 （预计返回的是user）
						if (user != null && user != '') {
							var dateTime= user.DateTime;						
							$('#Stay_Moulding').val(parseInt((clock-dateTime)/(1000*60)));
							$("#Order_ID").val(user.Order_id);
						} else {
							alert('暂时无数据！');
							}
						}
				});
		});
	
	/////
	$("#complete").click("click", function() {
		//记录完成装模时间 
		complete=(new Date()).getTime(); 
		$("#Moulding").val(parseInt((complete-clock)/(1000*60)));
		$('#recordingTime').val(complete);
		
	});
});
                                        
</script>
<style type="text/css">
.col-sm-3 {
	width: 15%;
	float: left;
}

.col-sm-9 {
	width: 85%;
	float: left;
}

label[class^="btn btn-default"] {
	margin-top: -4px;
}
</style>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	
	<button class="btn btn-success btn-s-xs" id="machine">上模</button>
	<button class="btn btn-success btn-s-xs" id="complete">完成装模</button>
	<form id="form" name="form" class="form-horizontal" method="post"
		action="${pageContext.request.contextPath}/progress/statistics_addEntity.shtml">
		<input type="hidden" class="form-control checkabh" name="recordingTime" id="recordingTime" />
		<section class="panel panel-default">
		<div class="form-group">
		
				<label class="col-sm-3 control-label">机台号：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control checkabh" value=""
							placeholder="请输入机台号" name="progressFormMap.Machine_Number" id="Machine_Number" />
					</div>
				</div> 
				<div class="line line-dashed line-lg pull-in"></div>
				
				<div class="form-group">
					<label class="col-sm-3 control-label">模具号：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control checkabh" value=""
							placeholder="请输入模具号" name="progressFormMap.Mold_Number" id="Mold_Number"/>
						</div>
				</div> 
				<div class="line line-dashed line-lg pull-in"></div>
					<div class="form-group">
					<label class="col-sm-3 control-label">订单号：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control checkabh" id="Order_ID"
							placeholder="请输订单号" name="progressFormMap.Order_ID" />
						</div>
				</div> 
				<div class="line line-dashed line-lg pull-in"></div>
				
				<div class="form-group">
					<label class="col-sm-3 control-label">待装模时间：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control checkabh" id="Stay_Moulding"
							readonly placeholder="请输入待装模时间" name="progressFormMap.Stay_Moulding" />
						</div>
				</div> 
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">装模时间：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control checkabh" 
						readonly	id="Moulding"  placeholder="请输入装模时间" name="progressFormMap.Moulding"  />
						</div>
				</div> 
				<div class="line line-dashed line-lg pull-in"></div>
					<div class="form-group">
					<label class="col-sm-3 control-label">实际时间 ：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control checkabh" id="Actual_Moulding"
						readonly	placeholder="请输入实际装模时间" name="progressFormMap.Actual_Moulding" />
						</div>
				</div> 
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">调机检查时间 ：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control checkabh" id="Check_Machine"
						readonly	placeholder="请输入调机检查时间" name="progressFormMap.Check_Machine" />
						</div>
				</div> 
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">判定 ：</label>
					<div class="col-sm-9">
						<select style="width: 30%; display: inline;" class="form-control" name="progressFormMap.Determine">
						<option value="1">合格</option>
						<option value="0">不合格</option>
					</select>
				</div>
				</div> 
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">异常处理 ：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control checkabh" 
							placeholder="请输入异常处理 " name="progressFormMap.Exception_Remake" />
						</div>
				</div> 
				<div class="line line-dashed line-lg pull-in"></div>
		<footer class="panel-footer text-right bg-light lter">
		<button type="submit" class="btn btn-success btn-s-xs">提交</button>
		</footer>
		</section>
</form>
</body>
</html>